<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  
 </body>
</html>
<script>
//010-12345678,0418-12345678
//^0[0-9]{2,3}-12345678
var phone = prompt('请输入电话号码');
var re = /^0[0-9]{2,3}-12345678$/g;
if (re.test(phone))
{
	alert('是本地电话');
}else{
	alert('不是本地电话');
};
</script>
